<template>
  <a-form :form="form">
    <a-row>
      <a-col :span="24">
        <a-form-item :labelCol="labelCol1" :wrapper-col="wrapperCol1" :label="i18n('form.calendarMode', '日历视图类型')">
          <a-select default-value="day"  id="tempType" v-model="calendarMode" style="width: 80%" @change="changeType">
            <a-select-option key="year" value="year">{{i18n('form.month','月份')}}</a-select-option>
            <a-select-option key="month" value="month">{{i18n('form.date','日期')}}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>

    </a-row>
  </a-form>
</template>

<script>
  import InsColumnDefApi from '@/api/portal/core/insColumnDef';
  import {BaseForm, RxDialog,Dialog} from "@lowcode/jpaas-common-lib";
  import rxAjax from '@/assets/js/ajax.js';

  export default {
    name: "insColumnDefCalendar",
    mixins: [BaseForm],
    components: {
      RxDialog, rxAjax,InsColumnDefApi
    },
    props: {
      dataObj: {
        type: Object,
        default: null
      }
    },
    data() {
      return {
        calendarMode: this.dataObj.calendarMode ||"month",
      }
    },
    methods: {
      i18n(name,text,key){
          return this.$ti18(name,text,"insColumnDef",key);
      },
      changeType(val){
        this.dataObj.calendarMode= this.calendarMode;
        this.$emit("change", this.dataObj);
      },
      valid(){
        if(!this.calendarMode){
          this.$confirm({
            title: this.$ti18('rxMsa.masWarn.delInfo','警告'),
            content: this.i18n('form.calendarMode','日历视图类型','input'),
              okText: this.$ti18('rxForm.okBtn','确认'),
              cancelText: this.$ti18('rxForm.cancelBtn','取消'),
          });
          return false;
        }
        return true;
      }
    }

  }
</script>

<style scoped>

</style>